{include file="public/head"}

<body>
	<div class="swiper-container headerImages">
		<div class="swiper-wrapper">
			{volist name="rotate" id="vo"}
			<a class="swiper-slide" href="{$vo.url}">
				<img src="{$vo.image}" alt="图片丢失" />
			</a>
			{/volist}
		</div>
		<div class="swiper-pagination"></div>
	</div>
	<div class="menuCent">
		{volist name="icon" id="vo"}
		<a href="{$vo.icon_url}">
			<div class="menuCent-top">
				<img src="{$vo.icon_logo}" alt="图片丢失" />
			</div>
			<div class="menuCent-bot">
				{$vo.icon_name}
			</div>
		</a>
		{/volist}
	</div>
	<div class="dressCard">
		<!-- <a href="javascript:;">
				<img src="__STATIC__/home/img/img6.png" alt="图片丢失" class="dressCard-left"/>
				<div class="dressCard-right">
					<div class="dressCard-right-one">
						<span>小汽车自动挡</span>
						<span>C2</span>
					</div>
					<div class="dressCard-right-two">
						1000人已报名
					</div>
					<div class="dressCard-right-three">
						<div class="dressCard-right-three-left floatLeft">
							<div class="floatLeft">
								<span class="redCol">2</span>人团
							</div>
							<div class="floatLeft"></div>
							<div class="floatLeft redCol">￥3970</div>
							<div class="floatLeft">
								差<span class="redCol">1</span>人
							</div>
						</div>
						<div class="dressCard-right-three-right floatRight">去参团</div>
					</div>
				</div>
			</a> -->
	</div>
	<div class="clickMore">
		查看更多
	</div>
	<div class="baseline" style="display: none;">
		<div></div>
		<div>暂无更多数据</div>
		<div></div>
	</div>
	{include file="public/footer"}
	<script src="__STATIC__/home/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
	<script src="__STATIC__/home/js/swiper.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(function () {
			var heg = $(window).height();
			$("body").css("min-height", heg);
			$("body").css("background-color", "#f9f9f9");
			$("body").css("padding-bottom", "1.6rem");
			//				轮播
			var swiper = new Swiper('.swiper-container', {
				spaceBetween: 30,
				centeredSlides: true,
				autoplay: {
					delay: 2500,
					disableOnInteraction: false,
				},
				pagination: {
					el: '.swiper-pagination',
					clickable: true,
				},
			});
			// 商品列表接口
			var page = 1;
			var limit = 10;
			var is_home = 1;
			// 商品列表接口
			requestList();
			function requestList() {
				$.ajax({
					type: 'post',
					url: '/index/goods/goodsListData',
					data: {
						page,
						limit,
						is_home
					},
					success(res) {
						if (res.code == 1) {
							var list = res.data || [];
							var html = '';
							list.forEach(function (item) {
								if (item.assemble) {
									html += `
									<a href="/index/assemble/assembleInfo?id=${item.id}">
										<img src="${item.image}" alt="图片丢失" class="dressCard-left"/>
										<div class="dressCard-right">
											<div class="dressCard-right-one">
												<span>${item.good_name}</span>
											</div>
											<div class="dressCard-right-two">
												${item.subscription}人已报名
											</div>
											<div class="dressCard-right-three">
												<div class="dressCard-right-three-left floatLeft">
													<div class="floatLeft">
														<span class="redCol">${item.assemble.number}</span>人团
													</div>
													<div class="floatLeft"></div>
													<div class="floatLeft redCol">￥${item.assemble.a_price}</div>
													<div class="floatLeft">
													</div>
												</div>
												<div class="dressCard-right-three-right floatRight">去参团</div>
											</div>
										</div>
									</a>
                                `;
								} else {
									html += `
                                    <a href="/index/goods/goodsInfo?id=${item.id}">
                                        <img src="${item.image}" alt="图片丢失" class="dressCard-left" />
                                        <div class="dressCard-right">
                                            <div class="dressCard-right-one">
                                                <span>${item.good_name}</span>
                                            </div>
                                            <div class="dressCard-right-two">
                                                ${item.subscription}人已报名
                                            </div>
                                            <div class="dressCard-right-three">
                                                <div class="dressCard-right-three-left floatLeft">
                                                    <div class="floatLeft redCol">￥${item.price}</div>
                                                </div>
                                                <div class="dressCard-right-three-right floatRight">去报名</div>
                                            </div>
                                        </div>
                                    </a>
                                `;
								}
							});
							$('.dressCard').append(html);
						} else {
							$('.clickMore').hide();
							$('.baseline').show();
						}
					},
					error() {
						console.log('商品列表接口错误');
					}
				})
			};
			// clickMore
			$('.clickMore').click(function () {
				page++;
				requestList();
			});
		});
	</script>
</body>

</html>